<?php
$cs=Yii::app()->clientScript;
$cs->registerScriptFile(Yii::app()->request->baseUrl.'/js/jquery.bgiframe.js',CClientScript::POS_HEAD );
//$cs->registerCss('footer_hack', '#footer{margin-top:0;}');
?>
<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/sub-lunhuan.js" type="text/javascript"></script>
<style type="text/css">
    .slider_block { width:960px; height:285px; margin-top: 0; margin-right: auto; margin-bottom: 0; margin-left: auto; }
    .slider_block img.screen { float:left; width:960px; }
    #slider { list-style:none; width:960px; height:285px; margin-top: 0; margin-right: auto; margin-bottom: 0; margin-left: auto; }
    #slider ul, #slider li { padding:0; margin:0; list-style:none; }
    #slider li { width:960px; height:285px; overflow:hidden; }

</style>

<?php $this->pageTitle=Yii::app()->name;

?>

<!-- Banner 轮换模块-->
  <div class="banner">

      <div class="long_block_index">
          <div class="js_imgs_block">
              <div id="slideshow_wrapper">
                  <div id="slider">
                      <ul>
                      <?php
                      $ads=Ads::model()->findAll('cid=1');
                      $i=1;
                      if(!empty($ads)) foreach($ads as $ad){
                          echo '<li><a title="'.$ad->title.'" style="z-index: '.$i.'" href="'.$ad->url.'" index="'.$i.
                              '"><img border=0 src="'.'/images/gallery/'.$ad->img.'"></a></li>';
                          $i++;
                      }
                      ?>
                      </ul>
                  </div>
                  <div id="slideshow_footbar"></div>
              </div>
          </div>
      </div>
      <div class="survey_block_index">
          <div class="title_survey_block_index">
              <ul class="scrollul">
                  <a id=m01 class=sd01 href="javascript:void(0)"></a>
                  <a id=m02 class=sd02 href="javascript:void(0)"></a>
                  <a style=" background-image:none" id="m03" class="sd03" href="javascript:void(0)"></a>
              </ul>
          </div>
      </div>
  </div>
<div class="h8"></div>


<!-- 中间区域-->
<div class="container">
    <div class="left">
        <?php
        $this->widget('application.extensions.tools.ArticleList',array(
            'cid'=>16,
            'pos'=>'left'
        ));
        ?>
    </div>
    <div class="center">
        <?php
        $this->widget('application.extensions.tools.ArticleList',array(
            'cid'=>17,
            'pos'=>'center'
        ));
        ?>
    </div>
    <div class="right">
        <?php
        if(Yii::app()->user->id>0):?>
            <!--标题-->
            <div class="k-title">
                <div class="l">登陆状态</div>
                <div class="hy"><span class="more black"><a href="/index.php?r=manage/index">会员中心</a></span></div>
            </div>
            <!--列表内容-->
            <div class="k-left-content">
                <a id="logout" href="/index.php?r=user/logout">退出登陆</a>
            </div>
            <!--底部圆角-->
            <div class="k-fot"> <span class="fotright"></span> </div>
            <!--圆角结束-->
        <?php else:?>
        <!--会员登录-->
        <div class="hy-title"></div>
        <form method="post" action="/index.php?r=site/login">
        <div class="hy-content">
            <table width="100%" border="0" cellpadding="15" cellspacing="0" class="login">
                <tr>
                    <td width="28%" align="right" valign="middle">会员名：</td>
                    <td width="72%">
                        <input type="text" maxlength="20" id="Users_username" name="Users[username]" class="text155" class="input" >
                        <div id="selectItem" class="selectItemhidden">
<!--                            <div id="selectItemAd" class="selectItemtit bgc_ccc">-->
<!--                                <h2 id="selectItemTitle" class="selectItemleft">内容提示</h2>-->
<!--                                <div id="selectItemClose" class="selectItemright">关闭</div>-->
<!--                            </div>-->
                            <div id="selectItemCount" class="selectItemcont">
                                <div id="selectSub">
                                    注册时启用的个人、单位会员名称；或电子邮箱；或会员注册后获取的注册号。
                                </div>
                            </div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right" valign="middle">密&nbsp;&nbsp;码：</td>
                    <td>
                        <?php echo CHtml::activePasswordField($user,'password',array('class'=>"text155")) ?>
                    </td>
                </tr>
                <tr>
                    <td align="right" valign="middle">验证码：</td>
                    <td>
                        <input id="Users_verifyCode" name="Users[verifyCode]" type="text" class="text70" id="textfield3" />
                        <img alt="" src="/index.php?r=site/captcha" id="yzm" />
                    </td>
                </tr>
            </table>
            <div class="button"><input type="submit" style="font-size: 0;border: 0;" id="login"></input></div>
            <p>新会员<span class="red"><a href="/index.php?r=profiles/register">免费注册</a></span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="forget-pwd black1"><a href="/index.php?r=user/recovery">忘记密码？</a></span></p>
        </div>
        </form>
        <div class="hy-fot"></div>
        <?php endif;?>
    </div>
    <div class="clear"></div>
</div>
<script type="text/javascript">
/*<![CDATA[*/
    jQuery(function($) {
        jQuery('#yzm').after("<span class=\"black\"><a id=\"yw0_button\" href=\"\/index.php?r=site\/captcha&amp;refresh=1\">换一张<\/a><\/span>");
        jQuery('#yw0_button').live('click',function(){
            jQuery.ajax({
                url: "\/index.php?r=site\/captcha&refresh=1",
                dataType: 'json',
                cache: false,
                success: function(data) {
                    jQuery('#yzm').attr('src', data['url']);
                    jQuery('body').data('captcha.hash', [data['hash1'], data['hash2']]);
                }
            });
            return false;
        });
    });
/*]]>*/
</script>
<div class="h8"></div>
<!--容器-->
<div class="container">
    <div class="left">
        <?php
        $this->widget('application.extensions.tools.ArticleList',array(
            'cid'=>25,
            'pos'=>'left',
            'show_time'=>false,
            'li_class'=>'y',
        ));
        ?>
    </div>
    <div class="center">
        <!--图片轮换-->

        <div id="subbanner">
            <div id="banner_bg"></div>
            <!--标题背景-->
            <div id="banner_info"></div>
            <!--标题-->
            <ul>
                <?php
                $ads=Ads::model()->findAll('cid=2');
                $i=1;
                $img_body = '';
                $img_title = '';
                if(!empty($ads)) foreach($ads as $ad){
                    $img_body .= '<a href="'.$ad->url.'" target="_blank"><img src="/images/gallery/'.$ad->img.
                        '" title="'.$ad->title.'" alt="'.$ad->title.'" /></a>';
                    if($i==1){
                       $img_title .= '<li class="on">1</li>';
                    }else{
                        $img_title .= '<li>'.$i.'</li>';
                    }
                    $i++;
                }
                echo $img_title;
                ?>
            </ul>
            <div id="banner_list">
                <?php echo $img_body;?>
            </div>
        </div>

        <!--end-->
    </div>
    <div class="right">
        <?php
        $this->widget('application.extensions.tools.ArticleList',array(
            'cid'=>23,
            'pos'=>'right',
            'show_time'=>false,
            'li_class'=>'y',
        ));
        ?>
    </div>
    <div class="clear"></div>
</div>
<div class="h8"></div>
<div class="ad">
    <?php
    $ad=Ads::model()->find('cid=3');
    if(!empty($ad)){
        echo '<a href="'.$ad->url.'" title="'.$ad->title.'"><img src="/images/gallery/'.$ad->img.'" width="960" height="93"/></a>';
    }
    ?>
</div>
<div class="h8"></div>
<div class="container twocolumn">
    <div class="left">
        <div class="l"><a href="/index.php?r=article/title&name=申报咨询" title="申报咨询"><img src="images/index_35.gif" width="276" height="78" border="0" /></a></div>
        <div class="l"><a href="/index.php?r=article/title&name=学会会员" title="学会会员"><img src="images/index_38.gif" width="276" height="76" border="0" /></a></div>
        <div class="l"><a href="/index.php?r=article/title&name=实训联盟" title="实训联盟"><img src="images/index_41.gif" width="278" height="79" border="0" /></a></div>
    </div>
    <div class="right zp">
        <div class="zp-title white">
            <div id="ap-title"><span>团体单位会员</span></div>
            <span class="more"><a href="<?php echo Yii::app()->createUrl('cate/list',array('pid'=>9));?>">更多</a></span> </div>
        <ul class="zp-content zp-href">
            <?php
            $criteria=new CDbCriteria;
            $criteria->condition='audit=1';
            $criteria->limit=14;
            $criteria->with='user';
            $criteria->group='uid';
            $jobs = Job::model()->findAll($criteria);

            $i=1;
            if(!empty($jobs))foreach($jobs as $job){
                $user=Users::model()->with('p')->findByPk($job->uid);
                if($i%4 == 1 || $i%4 == 2){
                    echo '<li>'.
                        '<span style="float:left;overflow:hidden;width:200px;"><a style="color:#000000;" title="'.$user->username.
                        '" href="/index.php?r=job/company&uid='.$user->id.'">'.$user->p->nickname.'</a></span>'.
                        '<span style="float:right;width:115px;text-align:left;overflow:hidden;"><a style="color:#123DB4" title="'.$job->title.
                        '" href="'.Yii::app()->createUrl('job/view', array('id'=>$job->jid)).'">'.$job->title.'</a></span>'.

                        '</li>';
                }else if($i%4 == 3 || $i%4 == 0){
                    echo '<li class="change">'.
                        '<span style="float:left;overflow:hidden;width:200px;"><a style="color:#000000;" title="'.$user->username.
                        '" href="/index.php?r=job/company&uid='.$user->id.'">'.$user->p->nickname.'</a></span>'.
                        '<span style="float:right;width:115px;text-align:left;overflow:hidden;"><a style="color:#123DB4" title="'.$job->title.
                        '" href="'.Yii::app()->createUrl('job/view', array('id'=>$job->jid)).'">'.$job->title.'</a></span>'.

                        '</li>';
                }
                $i++;
            }
            ?>
        </ul>
        <div class="zp-fot"><span class="l"></span><span class="r"></span></div>
    </div>
    <div class="clear"></div>
</div>
<div class="h8"></div>
<!-- 友情链接-->
<div class="friendlink">
    <div class="title">
        <div class="l">本站增值战略合作伙伴</div>
        <div class="r"></div>
    </div>
    <ul>
        <?php
        $criteria=new CDbCriteria;
        $criteria->condition='type=1';
        $criteria->limit=16;
        $links=Ads::model()->findAll($criteria);
        if(!empty($links)) foreach($links as $link){
            echo  '<li><a title="'.$link->title.'" href="'.$link->url.
                '"><img src="/images/gallery/'.$link->img.'" width="115" height="55" /></a></li>';
        }
        ?>
        <div class="clear"></div>
    </ul>
    <div class="fot"></div>
    <div class="h8"></div>
</div>
<!-- 友情链接-->

<script type="text/javascript">

    $(document).ready(function(){
        $("#slider").easySlider({
            auto: true,
            continuous: true
        });
        $("#selectItem").hide();
        $("#Users_username").selectCity("#selectItem");
    });
</script>